Fix clean offload clearing of non-checkpoint tensors#1583
Merged
Conversation
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes clean-mode offload so it preserves runtime-added (non-checkpoint) parameters/buffers by only clearing tensors that can be restored from the original checkpoint.
Changes:
- Add selective clearing in
_clear_module_weightsvia arestorable_paramsallowlist. - Cache and use a checkpoint weight map to determine which state entries under a block are restorable.
- Thread
block_namethrough offload/clear callsites to enable block-scoped restorable filtering.
xin3he
approved these changes
Mar 20, 2026
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
…-round into lvl/fix_clean_offload
for more information, see https://pre-commit.ci
9 tasks
…ix_clean_offload
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
…ix_clean_offload
…-round into lvl/fix_clean_offload
chensuyue
approved these changes
Mar 25, 2026
Contributor
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Preserve dynamically registered parameters and buffers during clean-mode offload.
Previously, clean-mode clearing removed all local tensors under a block, including runtime-added state that does not exist in the original checkpoint. Those tensors could not be restored during reload, leaving modules with empty tensors after offload and reload cycles. Clean mode now clears only tensors that can actually be restored from checkpoint while preserving runtime quantization state.
Type of Change
Related Issues
#1573
Checklist Before Submitting